package string_question.leecode.test115;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/7/8 9:06
 */
public class Solution1 {

    int count = 0;

    public int numDistinct(String s, String t) {
        if (s.length() < t.length()) return 0;
        helper(s, t, 0, 0);
        return count;
    }

    private void helper(String s, String t, int c1, int c2) {
        if (c2 == t.length()) {
            count++;
            return;
        }
        if (c1 == s.length()) return;
        if (s.charAt(c1) == t.charAt(c2)) {
            helper(s, t, c1 + 1, c2 + 1);
        }
        helper(s, t, c1 + 1, c2);
    }
}
